package org.keum.android.lecture;

import java.util.Date;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Now extends Activity implements OnClickListener {
	Button btn;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		btn = new Button(this);
		btn.setOnClickListener(this);
		updateTime();
		setContentView(btn);
	}

	private void updateTime() {
		btn.setText(new Date().toLocaleString());
	}

	public void onClick(View v) {
		updateTime();
	}

}
